package com.neusoft.elmboot.mapper;

import com.neusoft.elmboot.po.Score;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ScoreMapper {
	@Select("select * from score where userId=#{userId} order by scoreId")
	public List<Score> listScoreByUserId(String userId);
	
	@Delete("delete from score where scoreId=#{scoreId}")
	public int removeScore(Integer scoreId);

	@Insert("INSERT INTO score (scoreId, userId, orderId, scoreCount, createDate, deadLine) " +
			"VALUES (#{scoreId}, #{userId}, #{orderId}, #{scoreCount}, #{createDate}, #{deadLine})")
	@Options(useGeneratedKeys=true, keyProperty = "scoreId", keyColumn = "scoreId")
	public int saveScore(Score score);

}
